﻿<Page
    x:Class="WellDone.SplitMenuItemsDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WellDone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.Resources>
        <Style x:Key="ListViewItemStyleOpenRPOS" TargetType="ListViewItem">
            <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
            <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="IsHoldingEnabled" Value="True"/>
            <Setter Property="Margin" Value="0,0,18,2"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListViewItem">
                        <ListViewItemPresenter SelectedBorderThickness="0" CheckHintBrush="{ThemeResource ListViewItemCheckHintThemeBrush}" CheckBrush="{ThemeResource ListViewItemCheckThemeBrush}" ContentMargin="3" ContentTransitions="{TemplateBinding ContentTransitions}" CheckSelectingBrush="{ThemeResource ListViewItemCheckSelectingThemeBrush}" DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}" DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}" DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}" DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}" FocusBorderBrush="{ThemeResource ListViewItemFocusBorderThemeBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" PointerOverBackgroundMargin="1" PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" PointerOverBackground="{ThemeResource ListViewItemPointerOverBackgroundThemeBrush}" ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" SelectedPointerOverBorderBrush="{ThemeResource ListViewItemSelectedPointerOverBorderThemeBrush}" SelectionCheckMarkVisualEnabled="False" SelectedForeground="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" SelectedPointerOverBackground="{ThemeResource ListViewItemSelectedPointerOverBackgroundThemeBrush}" SelectedBackground="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>
    <Grid
        x:Name="RootPanel"
        Background="#FF98DEF8"
        Opacity=".75"
        HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch">

        <Grid x:Name="LayoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Width="900" Height="600" >
            <Grid.RowDefinitions>
                <RowDefinition Height="80" />
                <RowDefinition Height="430" />
                <RowDefinition Height="80" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="300" x:Name="colMainCheck" />
                <ColumnDefinition Width="2*" x:Name="colSplitChecks" />
            </Grid.ColumnDefinitions>

            <Canvas Name="SplitChecksHeader0" Grid.Row="0"  Grid.Column="0" Background="Gray" >
                <TextBlock HorizontalAlignment="Center" FontSize="30" TextWrapping="Wrap" Margin="5,5,0,0" VerticalAlignment="Top" Text="Order No :"/>
                <TextBlock x:Name="lblOrderNo" HorizontalAlignment="Center" FontSize="30" TextWrapping="Wrap" Text="1" Margin="150,5" VerticalAlignment="Top"/>
                <TextBlock HorizontalAlignment="Center" FontSize="30" TextWrapping="Wrap" Margin="5,40,0,0" VerticalAlignment="Top" Text="Table  No :"/>
                <TextBlock x:Name="lblTableNo" HorizontalAlignment="Center" FontSize="30" TextWrapping="Wrap" Text="1" Margin="150,40" VerticalAlignment="Top"/>
            </Canvas>
            <Canvas Name="SplitChecksHeader1" Grid.Row="0"  Grid.Column="1" Background="Gray" >
                <TextBlock HorizontalAlignment="Right" Margin="200,20,10,0" FontSize="30" TextWrapping="Wrap" Text="Split # of Ways" VerticalAlignment="Top" />
                <TextBox x:Name="tbSplit" HorizontalAlignment="Left" Margin="410,16,0,0" FontSize="28" TextWrapping="Wrap" Text="2" VerticalAlignment="Top" SelectionHighlightColor="#FF98DEF8" MaxLength="2" InputScope="Number" IsReadOnly="True"/>
                <Button x:Name="btnAddCheck" HorizontalAlignment="Left" Margin="475,14,0,0" VerticalAlignment="Top" Height="54" Width="80" Click="btnAddCheck_Click" ToolTipService.ToolTip="Add check" >
                    <!--<Path Fill="Black" Data="M 0 6 L 12 6 L 6 0 Z" Height="25" Stretch="Fill" UseLayoutRounding="False" Width="40"/>-->
                    <Path Margin="0" Stroke="Black" Data="M0,20 H40 M20,20 V40Z"  StrokeThickness="15" Height="40" Width="40" UseLayoutRounding="False" />
                </Button>
            </Canvas>

            <Border Name="brdMainCheck" Grid.Row="1" Grid.Column="0"  BorderThickness="2" BorderBrush="Black" Background="LightGray" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" Height="430" PointerPressed="brdMainCheck_PointerPressed">
                <Grid Margin="2,2,2,2" Name="grdMainCheck">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40" />
                        <RowDefinition Height="40" />
                        <RowDefinition />
                        <RowDefinition Height="40" />
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0" x:Name="MainCheckHeaderstrip" Background="LightGray">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  />
                        </Grid.ColumnDefinitions>
                        <Border BorderThickness="2" BorderBrush="Black"></Border>
                        <TextBlock Grid.Column="0" Text="Select check # 1 items" FontSize="28" Margin="5,4,10,0"  x:Name="tblkHeader" Grid.ColumnSpan="2"/>
                    </Grid>
                    <Grid Grid.Row="1" x:Name="MainCheckHeader" Background="LightGray">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  />
                            <ColumnDefinition  />
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Item" FontSize="28" Margin="5,4,0,0" />
                        <TextBlock Grid.Column="1" Margin="0,4,15,0" HorizontalAlignment="Right" Text="Price" FontSize="28" />
                    </Grid>
                    <ListView x:Name="lvMenuItems" Grid.Row="2" HorizontalAlignment="Center" Height="304" Margin="0,0,0,0" Background="White" VerticalAlignment="Top" Width="296" ItemContainerStyle="{StaticResource ListViewItemStyleOpenRPOS}" IsSwipeEnabled="False" SelectionMode="Multiple" SelectionChanged="lvMenuItems_SelectionChanged"  PointerPressed="lstMenuItems_PointerPressed"  Tag="-1">
                        <ListView.ItemContainerTransitions>
                            <TransitionCollection/>
                        </ListView.ItemContainerTransitions>
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="0,0,0,0" >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="200" />
                                        <ColumnDefinition Width="90" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="{Binding MenuItemName}" FontSize="28" Margin="5,0,0,0" />
                                    <TextBlock Grid.Column="1" Text="{Binding DisplayPrice}" FontSize="28" Margin="0,0,18,0"  HorizontalAlignment="Right" />
                                </Grid>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                    <Grid Grid.Row="3" x:Name="MainCheckFooter" Background="LightGray">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  />
                            <ColumnDefinition  />
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Subtotal" FontSize="28" Margin="5,4,0,0" />
                        <TextBlock Name="lblOrderTotal" Grid.Column="1" Margin="0,4,15,0" HorizontalAlignment="Right" Text="0.00" FontSize="28" />
                    </Grid>
                </Grid>
            </Border>
            <ScrollViewer Grid.Row="1" Grid.Column="1" Width="600" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <Canvas Name="SplitChecksContainer" Width="600" Background="Beige" ScrollViewer.HorizontalScrollMode="Auto" >

                </Canvas>
            </ScrollViewer>
            <Canvas Name="SplitChecksFooter" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="0" Background="LightGray" Margin="0,0,0,-10">
                <Button x:Name="btnOK" Content="OK" Width="120" Height="80" FontSize="28" Margin="30,5" VerticalAlignment="Center" HorizontalAlignment="Left" Click="btnOK_Click" />
                <Button x:Name="btnCancel" Content="Cancel" Width="120" Height="80" FontSize="28" Margin="750,5,0,5"  VerticalAlignment="Center" HorizontalAlignment="Right" Click="btnCancel_Click"  />
            </Canvas>
        </Grid>

    </Grid>
</Page>
